import 'package:flutter/material.dart';
import 'package:flutter_changdian_football/widget/screenutil/custom_screenutil.dart';

class CustomButton extends StatelessWidget {
  const CustomButton({
    super.key,
    this.text = '',
    this.onTap
  });

  final String text;

  final Function? onTap;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.translucent,
      onTap: () {
        onTap?.call();
      },
      child: Container(
        width: double.infinity,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(12),
          gradient: const LinearGradient(
            begin: Alignment(0.01, 0),
            end: Alignment(1, 1),
            colors: [
              Color.fromRGBO(18, 147, 96, 1.0),
              Color.fromRGBO(40, 100, 148, 1.0),
            ],
            stops: [0, 1.0],
          ),
          boxShadow: const [
            BoxShadow(
              color: Color.fromRGBO(18, 147, 96, 0.16),
              offset: Offset(0, 3),
              blurRadius: 12,
            ),
          ],
        ),
        padding: EdgeInsets.symmetric(vertical: 11.w),
        alignment: Alignment.center,
        child: Text(text, style: TextStyle(fontSize: 16.sp, color: Colors.white, fontWeight: FontWeight.w500),),
      ),
    );
  }
}